﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="RSBillingDataset" targetNamespace="http://tempuri.org/RSBillingDataset.xsd" xmlns:mstns="http://tempuri.org/RSBillingDataset.xsd" xmlns="http://tempuri.org/RSBillingDataset.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="ReadyServiceConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Public" Name="ReadyServiceConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.ReadyServiceConnectionString.ConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="rs_tblCompanyTableAdapter" GeneratorDataComponentClassName="rs_tblCompanyTableAdapter" Name="rs_tblCompany" UserDataComponentName="rs_tblCompanyTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="ReadyServiceConnectionString (Web.config)" DbObjectName="dbo.rs_tblCompany" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="GetCompanyData" GetMethodModifier="Public" GetMethodName="GetCompanyData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetCompanyData" UserSourceName="GetCompanyData">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[rs_tblCompany] WHERE (([ID] = @Original_ID))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int64" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="BigInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[rs_tblCompany] ([CompanyId], [CompanyName], [Street], [City], [State], [Zip], [Country]) VALUES (@CompanyId, @CompanyName, @Street, @City, @State, @Zip, @Country)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int64" Direction="Input" ParameterName="@CompanyId" Precision="0" ProviderType="BigInt" Scale="0" Size="0" SourceColumn="CompanyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@CompanyName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="CompanyName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Street" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Street" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@City" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="City" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@State" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="State" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Zip" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Zip" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Country" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Country" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT [ID]
      ,[CompanyId]
      ,[CompanyName]
      ,[Street]
      ,[City]
      ,[State]
      ,[Zip]
      ,[Country]
      ,[CompanyName] + CHAR(13) + CHAR(10) + [Street] + CHAR(13) + CHAR(10) + [City] + ', ' + [State] + ' ' + [Zip] AS CompanyNameFullAddress
  FROM [dbo].[rs_tblCompany]
WHERE CompanyId=@CompanyId</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="CompanyId" ColumnName="CompanyId" DataSourceName="dbo.rs_tblCompany" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@CompanyId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="CompanyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[rs_tblCompany] SET [CompanyId] = @CompanyId, [CompanyName] = @CompanyName, [Street] = @Street, [City] = @City, [State] = @State, [Zip] = @Zip, [Country] = @Country WHERE (([ID] = @Original_ID))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int64" Direction="Input" ParameterName="@CompanyId" Precision="0" ProviderType="BigInt" Scale="0" Size="0" SourceColumn="CompanyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@CompanyName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="CompanyName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Street" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Street" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@City" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="City" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@State" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="State" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Zip" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Zip" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Country" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Country" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int64" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="BigInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ID" DataSetColumn="ID" />
              <Mapping SourceColumn="CompanyId" DataSetColumn="CompanyId" />
              <Mapping SourceColumn="CompanyName" DataSetColumn="CompanyName" />
              <Mapping SourceColumn="Street" DataSetColumn="Street" />
              <Mapping SourceColumn="City" DataSetColumn="City" />
              <Mapping SourceColumn="State" DataSetColumn="State" />
              <Mapping SourceColumn="Zip" DataSetColumn="Zip" />
              <Mapping SourceColumn="Country" DataSetColumn="Country" />
              <Mapping SourceColumn="CompanyNameFullAddress" DataSetColumn="CompanyNameFullAddress" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="vw_WorkOrderInvoiceTableAdapter" GeneratorDataComponentClassName="vw_WorkOrderInvoiceTableAdapter" Name="vw_WorkOrderInvoice" UserDataComponentName="vw_WorkOrderInvoiceTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="ReadyServiceConnectionString (Web.config)" DbObjectName="RSSBM.dbo.vw_WorkOrderInvoice" DbObjectType="View" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="GetDataWorkOrderInvoice" GetMethodModifier="Public" GetMethodName="GetDataWorkOrderInvoice" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetDataWorkOrderInvoice" UserSourceName="GetDataWorkOrderInvoice">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT wi.InvoiceId
      ,wi.AdditionalFeeAmount
      ,wi.AdditionalDiscountAmount
      ,wi.TaxPercent
      ,wi.WorkOrderTotalMaterialCost_CF
      ,wi.WorkOrderTotalLaborCost_CF
      ,wi.WorkOrderTotalCost_CF
      ,wi.TaxAmount_CF
      ,wi.BalanceDue_CF
      ,wi.StatusId
      ,wi.WorkOrderId
      ,(SELECT l.Street + ', ' + l.City + ', ' + l.State + ' ' + l.Zip FROM rs_tblLocation l WHERE l.LocationId=wi.LocationId) AS JobAddress
      ,(SELECT c.FirstName + ' ' + c.LastName + '  ' + l.Street + ', ' + l.City + ', ' + l.State + ' ' + l.Zip FROM rs_tblLocation l INNER JOIN rs_tblContact c ON l.LocationId=c.BillingLocationId WHERE c.ContactId=wi.BillingContactId) AS BillTo
      ,wi.IsAdHoc
      ,wi.CompanyId
      ,wi.CreateDT
      ,wi.DueDT
      ,wi.SentDT
      ,wi.FirstName
      ,wi.MiddleName
      ,wi.LastName
      ,wi.Mobile
      ,wi.Phone
      ,wi.Street
      ,wi.City
      ,wi.State
      ,wi.Zip
      ,wi.AdditionalInstructions
      ,wi.Terms
      ,wi.InvoiceNo
      ,wi.PONumber
      ,wi.SubTotal
  FROM vw_WorkOrderInvoice wi
WHERE wi.CompanyId=@CompanyId AND wi.InvoiceId=@InvoiceId AND wi.WorkOrderId=@WorkOrderId
</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="CompanyId" ColumnName="CompanyId" DataSourceName="RSSBM.dbo.vw_WorkOrderInvoice" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@CompanyId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="CompanyId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="InvoiceId" ColumnName="InvoiceId" DataSourceName="RSSBM.dbo.vw_WorkOrderInvoice" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@InvoiceId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="InvoiceId" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="WorkOrderId" ColumnName="WorkOrderId" DataSourceName="RSSBM.dbo.vw_WorkOrderInvoice" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@WorkOrderId" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="WorkOrderId" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="InvoiceId" DataSetColumn="InvoiceId" />
              <Mapping SourceColumn="AdditionalFeeAmount" DataSetColumn="AdditionalFeeAmount" />
              <Mapping SourceColumn="AdditionalDiscountAmount" DataSetColumn="AdditionalDiscountAmount" />
              <Mapping SourceColumn="TaxPercent" DataSetColumn="TaxPercent" />
              <Mapping SourceColumn="WorkOrderTotalMaterialCost_CF" DataSetColumn="WorkOrderTotalMaterialCost_CF" />
              <Mapping SourceColumn="WorkOrderTotalLaborCost_CF" DataSetColumn="WorkOrderTotalLaborCost_CF" />
              <Mapping SourceColumn="WorkOrderTotalCost_CF" DataSetColumn="WorkOrderTotalCost_CF" />
              <Mapping SourceColumn="TaxAmount_CF" DataSetColumn="TaxAmount_CF" />
              <Mapping SourceColumn="BalanceDue_CF" DataSetColumn="BalanceDue_CF" />
              <Mapping SourceColumn="StatusId" DataSetColumn="StatusId" />
              <Mapping SourceColumn="WorkOrderId" DataSetColumn="WorkOrderId" />
              <Mapping SourceColumn="IsAdHoc" DataSetColumn="IsAdHoc" />
              <Mapping SourceColumn="CompanyId" DataSetColumn="CompanyId" />
              <Mapping SourceColumn="CreateDT" DataSetColumn="CreateDT" />
              <Mapping SourceColumn="DueDT" DataSetColumn="DueDT" />
              <Mapping SourceColumn="SentDT" DataSetColumn="SentDT" />
              <Mapping SourceColumn="FirstName" DataSetColumn="FirstName" />
              <Mapping SourceColumn="MiddleName" DataSetColumn="MiddleName" />
              <Mapping SourceColumn="LastName" DataSetColumn="LastName" />
              <Mapping SourceColumn="Mobile" DataSetColumn="Mobile" />
              <Mapping SourceColumn="Phone" DataSetColumn="Phone" />
              <Mapping SourceColumn="Street" DataSetColumn="Street" />
              <Mapping SourceColumn="City" DataSetColumn="City" />
              <Mapping SourceColumn="State" DataSetColumn="State" />
              <Mapping SourceColumn="Zip" DataSetColumn="Zip" />
              <Mapping SourceColumn="AdditionalInstructions" DataSetColumn="AdditionalInstructions" />
              <Mapping SourceColumn="Terms" DataSetColumn="Terms" />
              <Mapping SourceColumn="InvoiceNo" DataSetColumn="InvoiceNo" />
              <Mapping SourceColumn="PONumber" DataSetColumn="PONumber" />
              <Mapping SourceColumn="SubTotal" DataSetColumn="SubTotal" />
              <Mapping SourceColumn="JobAddress" DataSetColumn="JobAddress" />
              <Mapping SourceColumn="BillTo" DataSetColumn="BillTo" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="vw_WorkOrderInvoiceItemTableAdapter" GeneratorDataComponentClassName="vw_WorkOrderInvoiceItemTableAdapter" Name="vw_WorkOrderInvoiceItem" UserDataComponentName="vw_WorkOrderInvoiceItemTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="ReadyServiceConnectionString (Web.config)" DbObjectName="RSSBM.dbo.vw_WorkOrderInvoiceItem" DbObjectType="View" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="GetDataWorkOrderInvoiceItem" GetMethodModifier="Public" GetMethodName="GetDataWorkOrderInvoiceItem" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetDataWorkOrderInvoiceItem" UserSourceName="GetDataWorkOrderInvoiceItem">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT [workorderid]
      ,[companyid]
      ,[quantity]
      ,[workordername]
      ,[rate]
      ,[LaborCost]
  FROM [RSSBM].[dbo].[vw_WorkOrderInvoiceItem]
  WHERE companyid=@companyid AND workorderid=@workorderid
</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="companyid" ColumnName="companyid" DataSourceName="RSSBM.dbo.vw_WorkOrderInvoiceItem" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@companyid" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="companyid" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="workorderid" ColumnName="workorderid" DataSourceName="RSSBM.dbo.vw_WorkOrderInvoiceItem" DataTypeServer="bigint" DbType="Int64" Direction="Input" ParameterName="@workorderid" Precision="0" ProviderType="BigInt" Scale="0" Size="8" SourceColumn="workorderid" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="workorderid" DataSetColumn="workorderid" />
              <Mapping SourceColumn="companyid" DataSetColumn="companyid" />
              <Mapping SourceColumn="quantity" DataSetColumn="quantity" />
              <Mapping SourceColumn="workordername" DataSetColumn="workordername" />
              <Mapping SourceColumn="rate" DataSetColumn="rate" />
              <Mapping SourceColumn="LaborCost" DataSetColumn="LaborCost" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="RSBillingDataset" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="RSBillingDataset" msprop:Generator_UserDSName="RSBillingDataset">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="rs_tblCompany" msprop:Generator_TableClassName="rs_tblCompanyDataTable" msprop:Generator_TableVarName="tablers_tblCompany" msprop:Generator_TablePropName="rs_tblCompany" msprop:Generator_RowDeletingName="rs_tblCompanyRowDeleting" msprop:Generator_UserTableName="rs_tblCompany" msprop:Generator_RowChangingName="rs_tblCompanyRowChanging" msprop:Generator_RowEvHandlerName="rs_tblCompanyRowChangeEventHandler" msprop:Generator_RowDeletedName="rs_tblCompanyRowDeleted" msprop:Generator_RowEvArgName="rs_tblCompanyRowChangeEvent" msprop:Generator_RowChangedName="rs_tblCompanyRowChanged" msprop:Generator_RowClassName="rs_tblCompanyRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" msprop:Generator_UserColumnName="ID" type="xs:long" />
              <xs:element name="CompanyId" msprop:Generator_ColumnVarNameInTable="columnCompanyId" msprop:Generator_ColumnPropNameInRow="CompanyId" msprop:Generator_ColumnPropNameInTable="CompanyIdColumn" msprop:Generator_UserColumnName="CompanyId" type="xs:long" minOccurs="0" />
              <xs:element name="CompanyName" msprop:Generator_ColumnVarNameInTable="columnCompanyName" msprop:Generator_ColumnPropNameInRow="CompanyName" msprop:Generator_ColumnPropNameInTable="CompanyNameColumn" msprop:Generator_UserColumnName="CompanyName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Street" msprop:Generator_ColumnVarNameInTable="columnStreet" msprop:Generator_ColumnPropNameInRow="Street" msprop:Generator_ColumnPropNameInTable="StreetColumn" msprop:Generator_UserColumnName="Street" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="City" msprop:Generator_ColumnVarNameInTable="columnCity" msprop:Generator_ColumnPropNameInRow="City" msprop:Generator_ColumnPropNameInTable="CityColumn" msprop:Generator_UserColumnName="City" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="State" msprop:Generator_ColumnVarNameInTable="columnState" msprop:Generator_ColumnPropNameInRow="State" msprop:Generator_ColumnPropNameInTable="StateColumn" msprop:Generator_UserColumnName="State" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Zip" msprop:Generator_ColumnVarNameInTable="columnZip" msprop:Generator_ColumnPropNameInRow="Zip" msprop:Generator_ColumnPropNameInTable="ZipColumn" msprop:Generator_UserColumnName="Zip" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnPropNameInTable="CountryColumn" msprop:Generator_UserColumnName="Country" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CompanyNameFullAddress" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCompanyNameFullAddress" msprop:Generator_ColumnPropNameInRow="CompanyNameFullAddress" msprop:Generator_ColumnPropNameInTable="CompanyNameFullAddressColumn" msprop:Generator_UserColumnName="CompanyNameFullAddress" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="297" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="vw_WorkOrderInvoice" msprop:Generator_TableClassName="vw_WorkOrderInvoiceDataTable" msprop:Generator_TableVarName="tablevw_WorkOrderInvoice" msprop:Generator_TablePropName="vw_WorkOrderInvoice" msprop:Generator_RowDeletingName="vw_WorkOrderInvoiceRowDeleting" msprop:Generator_UserTableName="vw_WorkOrderInvoice" msprop:Generator_RowChangingName="vw_WorkOrderInvoiceRowChanging" msprop:Generator_RowEvHandlerName="vw_WorkOrderInvoiceRowChangeEventHandler" msprop:Generator_RowDeletedName="vw_WorkOrderInvoiceRowDeleted" msprop:Generator_RowEvArgName="vw_WorkOrderInvoiceRowChangeEvent" msprop:Generator_RowChangedName="vw_WorkOrderInvoiceRowChanged" msprop:Generator_RowClassName="vw_WorkOrderInvoiceRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="InvoiceId" msprop:Generator_ColumnVarNameInTable="columnInvoiceId" msprop:Generator_ColumnPropNameInRow="InvoiceId" msprop:Generator_ColumnPropNameInTable="InvoiceIdColumn" msprop:Generator_UserColumnName="InvoiceId" type="xs:long" />
              <xs:element name="AdditionalFeeAmount" msprop:Generator_ColumnVarNameInTable="columnAdditionalFeeAmount" msprop:Generator_ColumnPropNameInRow="AdditionalFeeAmount" msprop:Generator_ColumnPropNameInTable="AdditionalFeeAmountColumn" msprop:Generator_UserColumnName="AdditionalFeeAmount" type="xs:decimal" minOccurs="0" />
              <xs:element name="AdditionalDiscountAmount" msprop:Generator_ColumnVarNameInTable="columnAdditionalDiscountAmount" msprop:Generator_ColumnPropNameInRow="AdditionalDiscountAmount" msprop:Generator_ColumnPropNameInTable="AdditionalDiscountAmountColumn" msprop:Generator_UserColumnName="AdditionalDiscountAmount" type="xs:decimal" minOccurs="0" />
              <xs:element name="TaxPercent" msprop:Generator_ColumnVarNameInTable="columnTaxPercent" msprop:Generator_ColumnPropNameInRow="TaxPercent" msprop:Generator_ColumnPropNameInTable="TaxPercentColumn" msprop:Generator_UserColumnName="TaxPercent" type="xs:short" minOccurs="0" />
              <xs:element name="WorkOrderTotalMaterialCost_CF" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnWorkOrderTotalMaterialCost_CF" msprop:Generator_ColumnPropNameInRow="WorkOrderTotalMaterialCost_CF" msprop:Generator_ColumnPropNameInTable="WorkOrderTotalMaterialCost_CFColumn" msprop:Generator_UserColumnName="WorkOrderTotalMaterialCost_CF" type="xs:decimal" minOccurs="0" />
              <xs:element name="WorkOrderTotalLaborCost_CF" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnWorkOrderTotalLaborCost_CF" msprop:Generator_ColumnPropNameInRow="WorkOrderTotalLaborCost_CF" msprop:Generator_ColumnPropNameInTable="WorkOrderTotalLaborCost_CFColumn" msprop:Generator_UserColumnName="WorkOrderTotalLaborCost_CF" type="xs:decimal" minOccurs="0" />
              <xs:element name="WorkOrderTotalCost_CF" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnWorkOrderTotalCost_CF" msprop:Generator_ColumnPropNameInRow="WorkOrderTotalCost_CF" msprop:Generator_ColumnPropNameInTable="WorkOrderTotalCost_CFColumn" msprop:Generator_UserColumnName="WorkOrderTotalCost_CF" type="xs:decimal" minOccurs="0" />
              <xs:element name="TaxAmount_CF" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTaxAmount_CF" msprop:Generator_ColumnPropNameInRow="TaxAmount_CF" msprop:Generator_ColumnPropNameInTable="TaxAmount_CFColumn" msprop:Generator_UserColumnName="TaxAmount_CF" type="xs:decimal" minOccurs="0" />
              <xs:element name="BalanceDue_CF" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnBalanceDue_CF" msprop:Generator_ColumnPropNameInRow="BalanceDue_CF" msprop:Generator_ColumnPropNameInTable="BalanceDue_CFColumn" msprop:Generator_UserColumnName="BalanceDue_CF" type="xs:decimal" minOccurs="0" />
              <xs:element name="StatusId" msprop:Generator_ColumnVarNameInTable="columnStatusId" msprop:Generator_ColumnPropNameInRow="StatusId" msprop:Generator_ColumnPropNameInTable="StatusIdColumn" msprop:Generator_UserColumnName="StatusId" type="xs:int" minOccurs="0" />
              <xs:element name="WorkOrderId" msprop:Generator_ColumnVarNameInTable="columnWorkOrderId" msprop:Generator_ColumnPropNameInRow="WorkOrderId" msprop:Generator_ColumnPropNameInTable="WorkOrderIdColumn" msprop:Generator_UserColumnName="WorkOrderId" type="xs:long" minOccurs="0" />
              <xs:element name="IsAdHoc" msprop:Generator_ColumnVarNameInTable="columnIsAdHoc" msprop:Generator_ColumnPropNameInRow="IsAdHoc" msprop:Generator_ColumnPropNameInTable="IsAdHocColumn" msprop:Generator_UserColumnName="IsAdHoc" type="xs:boolean" minOccurs="0" />
              <xs:element name="CompanyId" msprop:Generator_ColumnVarNameInTable="columnCompanyId" msprop:Generator_ColumnPropNameInRow="CompanyId" msprop:Generator_ColumnPropNameInTable="CompanyIdColumn" msprop:Generator_UserColumnName="CompanyId" type="xs:long" minOccurs="0" />
              <xs:element name="CreateDT" msprop:Generator_ColumnVarNameInTable="columnCreateDT" msprop:Generator_ColumnPropNameInRow="CreateDT" msprop:Generator_ColumnPropNameInTable="CreateDTColumn" msprop:Generator_UserColumnName="CreateDT" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DueDT" msprop:Generator_ColumnVarNameInTable="columnDueDT" msprop:Generator_ColumnPropNameInRow="DueDT" msprop:Generator_ColumnPropNameInTable="DueDTColumn" msprop:Generator_UserColumnName="DueDT" type="xs:dateTime" minOccurs="0" />
              <xs:element name="SentDT" msprop:Generator_ColumnVarNameInTable="columnSentDT" msprop:Generator_ColumnPropNameInRow="SentDT" msprop:Generator_ColumnPropNameInTable="SentDTColumn" msprop:Generator_UserColumnName="SentDT" type="xs:dateTime" minOccurs="0" />
              <xs:element name="FirstName" msprop:Generator_ColumnVarNameInTable="columnFirstName" msprop:Generator_ColumnPropNameInRow="FirstName" msprop:Generator_ColumnPropNameInTable="FirstNameColumn" msprop:Generator_UserColumnName="FirstName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MiddleName" msprop:Generator_ColumnVarNameInTable="columnMiddleName" msprop:Generator_ColumnPropNameInRow="MiddleName" msprop:Generator_ColumnPropNameInTable="MiddleNameColumn" msprop:Generator_UserColumnName="MiddleName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="LastName" msprop:Generator_ColumnVarNameInTable="columnLastName" msprop:Generator_ColumnPropNameInRow="LastName" msprop:Generator_ColumnPropNameInTable="LastNameColumn" msprop:Generator_UserColumnName="LastName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="25" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Mobile" msprop:Generator_ColumnVarNameInTable="columnMobile" msprop:Generator_ColumnPropNameInRow="Mobile" msprop:Generator_ColumnPropNameInTable="MobileColumn" msprop:Generator_UserColumnName="Mobile" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Phone" msprop:Generator_ColumnVarNameInTable="columnPhone" msprop:Generator_ColumnPropNameInRow="Phone" msprop:Generator_ColumnPropNameInTable="PhoneColumn" msprop:Generator_UserColumnName="Phone" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Street" msprop:Generator_ColumnVarNameInTable="columnStreet" msprop:Generator_ColumnPropNameInRow="Street" msprop:Generator_ColumnPropNameInTable="StreetColumn" msprop:Generator_UserColumnName="Street" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="City" msprop:Generator_ColumnVarNameInTable="columnCity" msprop:Generator_ColumnPropNameInRow="City" msprop:Generator_ColumnPropNameInTable="CityColumn" msprop:Generator_UserColumnName="City" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="State" msprop:Generator_ColumnVarNameInTable="columnState" msprop:Generator_ColumnPropNameInRow="State" msprop:Generator_ColumnPropNameInTable="StateColumn" msprop:Generator_UserColumnName="State" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Zip" msprop:Generator_ColumnVarNameInTable="columnZip" msprop:Generator_ColumnPropNameInRow="Zip" msprop:Generator_ColumnPropNameInTable="ZipColumn" msprop:Generator_UserColumnName="Zip" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="15" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="AdditionalInstructions" msprop:Generator_ColumnVarNameInTable="columnAdditionalInstructions" msprop:Generator_ColumnPropNameInRow="AdditionalInstructions" msprop:Generator_ColumnPropNameInTable="AdditionalInstructionsColumn" msprop:Generator_UserColumnName="AdditionalInstructions" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="250" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Terms" msprop:Generator_ColumnVarNameInTable="columnTerms" msprop:Generator_ColumnPropNameInRow="Terms" msprop:Generator_ColumnPropNameInTable="TermsColumn" msprop:Generator_UserColumnName="Terms" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="250" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="InvoiceNo" msprop:Generator_ColumnVarNameInTable="columnInvoiceNo" msprop:Generator_ColumnPropNameInRow="InvoiceNo" msprop:Generator_ColumnPropNameInTable="InvoiceNoColumn" msprop:Generator_UserColumnName="InvoiceNo" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PONumber" msprop:Generator_ColumnVarNameInTable="columnPONumber" msprop:Generator_ColumnPropNameInRow="PONumber" msprop:Generator_ColumnPropNameInTable="PONumberColumn" msprop:Generator_UserColumnName="PONumber" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="SubTotal" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnSubTotal" msprop:Generator_ColumnPropNameInRow="SubTotal" msprop:Generator_ColumnPropNameInTable="SubTotalColumn" msprop:Generator_UserColumnName="SubTotal" type="xs:decimal" minOccurs="0" />
              <xs:element name="JobAddress" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnJobAddress" msprop:Generator_ColumnPropNameInRow="JobAddress" msprop:Generator_ColumnPropNameInTable="JobAddressColumn" msprop:Generator_UserColumnName="JobAddress" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="220" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="BillTo" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnBillTo" msprop:Generator_ColumnPropNameInRow="BillTo" msprop:Generator_ColumnPropNameInTable="BillToColumn" msprop:Generator_UserColumnName="BillTo" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="273" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="vw_WorkOrderInvoiceItem" msprop:Generator_TableClassName="vw_WorkOrderInvoiceItemDataTable" msprop:Generator_TableVarName="tablevw_WorkOrderInvoiceItem" msprop:Generator_TablePropName="vw_WorkOrderInvoiceItem" msprop:Generator_RowDeletingName="vw_WorkOrderInvoiceItemRowDeleting" msprop:Generator_UserTableName="vw_WorkOrderInvoiceItem" msprop:Generator_RowChangingName="vw_WorkOrderInvoiceItemRowChanging" msprop:Generator_RowEvHandlerName="vw_WorkOrderInvoiceItemRowChangeEventHandler" msprop:Generator_RowDeletedName="vw_WorkOrderInvoiceItemRowDeleted" msprop:Generator_RowEvArgName="vw_WorkOrderInvoiceItemRowChangeEvent" msprop:Generator_RowChangedName="vw_WorkOrderInvoiceItemRowChanged" msprop:Generator_RowClassName="vw_WorkOrderInvoiceItemRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="workorderid" msprop:Generator_ColumnVarNameInTable="columnworkorderid" msprop:Generator_ColumnPropNameInRow="workorderid" msprop:Generator_ColumnPropNameInTable="workorderidColumn" msprop:Generator_UserColumnName="workorderid" type="xs:long" minOccurs="0" />
              <xs:element name="companyid" msprop:Generator_ColumnVarNameInTable="columncompanyid" msprop:Generator_ColumnPropNameInRow="companyid" msprop:Generator_ColumnPropNameInTable="companyidColumn" msprop:Generator_UserColumnName="companyid" type="xs:long" minOccurs="0" />
              <xs:element name="quantity" msprop:Generator_ColumnVarNameInTable="columnquantity" msprop:Generator_ColumnPropNameInRow="quantity" msprop:Generator_ColumnPropNameInTable="quantityColumn" msprop:Generator_UserColumnName="quantity" type="xs:int" minOccurs="0" />
              <xs:element name="workordername" msprop:Generator_ColumnVarNameInTable="columnworkordername" msprop:Generator_ColumnPropNameInRow="workordername" msprop:Generator_ColumnPropNameInTable="workordernameColumn" msprop:Generator_UserColumnName="workordername" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="150" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="rate" msprop:Generator_ColumnVarNameInTable="columnrate" msprop:Generator_ColumnPropNameInRow="rate" msprop:Generator_ColumnPropNameInTable="rateColumn" msprop:Generator_UserColumnName="rate" type="xs:decimal" />
              <xs:element name="LaborCost" msprop:Generator_ColumnVarNameInTable="columnLaborCost" msprop:Generator_ColumnPropNameInRow="LaborCost" msprop:Generator_ColumnPropNameInTable="LaborCostColumn" msprop:Generator_UserColumnName="LaborCost" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:rs_tblCompany" />
      <xs:field xpath="mstns:ID" />
    </xs:unique>
    <xs:unique name="vw_WorkOrderInvoice_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:vw_WorkOrderInvoice" />
      <xs:field xpath="mstns:InvoiceId" />
    </xs:unique>
  </xs:element>
</xs:schema>